#
# @lc app=leetcode.cn id=125 lang=python3
#
# [125] 验证回文串
#

# @lc code=start
class Solution:
    def isPalindrome(self, s: str) -> bool:
        res = []
        for c in s.upper():
            if ord(c) >= 65 and ord(c) <= 90 or ord(c) >= 48 and ord(c) <= 57:
                res.append(c)
        if len(res) == 0: return True
        i = 0
        while res[i] == res[len(res) - i - 1] and i <= len(res) // 2 - 1:
            i += 1
        if i >= len(res) // 2: return True
        return False
                
# @lc code=end

